package com.gprcclient.web;

import com.gprcclient.feignapi.TestFeignApi;
import com.gprcclient.grpcapi.TestGrpcService;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

/**
 * @author: LCG
 * @date: 2022-10-25 12:05:50
 * @description:
 **/
@RestController
public class TestClientWeb {

    @Autowired
    private TestFeignApi testFeignApi;

    @Autowired
    private TestGrpcService testGrpcService;

    @RequestMapping(value = "test01")
    public Object test01() throws ExecutionException, InterruptedException {
        return testGrpcService.test01();
    }
    @RequestMapping(value = "test02")
    public Object test02() throws ExecutionException, InterruptedException {
        return testGrpcService.test02();
    }

    @RequestMapping("test03")
    public Object test03(){
      return  testFeignApi.test02("123213","12331212");
    }


    void orderInfo_TimeOutHandler(String id,Exception exception){
        System.out.println("--------------------"+id);
    }
}
